class MyController < ApplicationController
  before_filter :require_login

  def index
    page
    render :action => 'page'
  end

  def page
    @user = User.current
  end

  def account
    @user = User.current

    if request.put?
      if @user.update_attributes(params[:user])
        redirect_to :action => 'account'
        return
      end
    end
  end

  def destroy
    @user = User.current
    @user.destroy

    respond_to do |format|
      format.html { redirect_to users_url }
      format.json { head :no_content }
    end
  end
end
